<template>
  <div>
    <div class="title">
      <span class="iconfont">&#xe602;</span>
    猜你喜欢</div>
    <ul>
      <router-link
        tag='li'
        class='item'
        v-for='item of list'
        :key='item.id'
        :to="'/detail/'+item.id"
      >
        <div class="item-img-wrapper">
          <img class='item-img' :src="item.imgUrl">
        </div>
        <div class="item-info">
          <p class='item-title'>{{item.title}}</p>
          <p class='item-desc'>
            <span class='iconfont' v-html="item.desc"></span>
            <span class='comment'>{{item.comment}}</span>
          </p>
          <button class='item-btn'>查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  }
}
</script>

<style lang='stylus' scoped>
@import '~styles/mixins.styl'
  .title
    line-height: .8rem
    background: #eef
    text-indent: .4rem
    .iconfont
      color: #d81e06
  .item
    display: flex
    height: 2rem
    padding: .1rem;
    .item-img-wrapper
      width: 2rem
      height: 2rem
      padding: .1rem
      .item-img
        // width: 100%
        height: 100%
        display: block
    .item-info
      // flex: 1
      padding: .1rem
      overflow: hidden
      .item-title
        line-height:.6rem
      .item-desc
        line-height: .45rem
        ellipsis()
        min-width: 0
        .iconfont
          color: #f4a705
          font-size: .25rem
      .item-btn
        background: #f5ad15
        border-radius: .05rem
</style>
